#include"ui.h"
void ctrl_justice(Buyer_t* user_head)
{
	if(user_head -> next == NULL)
		return;
	Lottery_t* lott_head = NULL;
	lott_head = load_lott();
	if(lott_head -> next == NULL)
	{printf("hhhh");
		return;
	}
	int chose=0;
	while(1)
	{   
		system("clear");
		justice_center_ui();
		printf("情输入你的选择：");
		scanf("%d",&chose);
		cleaninput();
		switch(chose)
		{   
			case 1:
				printf("开奖\n");
				open_lott(user_head,lott_head);
				break;
			case 2:
				printf("查看彩票信息\n");
				show_lott_list(lott_head);
				printf("请按回车键返回\n");
				cleaninput();
				break;
			default:
				save_lott_list(lott_head);
				free_lott_list(lott_head);
				return;
		}   
	}   
}
